bitkeeper revision 1.1389.17.3 (42823d4825o1wYghBqsaekhllO6ocQ)
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 11 May 2005 17:13:44 +0000 (17:13 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 11 May 2005 17:13:44 +0000 (17:13 +0000)
Domain builders need only set bit 9 of EFLAGS (Interrupt Enable).
Setting this bit is enforced by Xen.
Signed-off-by: Keir Fraser <keir@xensource.com>
tools/libxc/xc_linux_build.c
tools/libxc/xc_plan9_build.c
tools/libxc/xc_vmx_build.c
xen/arch/x86/domain.c

index abf427f87fef8137c5acba41dd23511fc3fb4f3c..5ccbd20efbfaa8f585881c962ad95183d5ba77eb 100644 (file)
@@ -409,7 +409,7 @@ int xc_linux_build(int xc_handle,
     ctxt->user_regs.eip = vkern_entry;
     ctxt->user_regs.esp = vstartinfo_start + 2*PAGE_SIZE;
     ctxt->user_regs.esi = vstartinfo_start;
-    ctxt->user_regs.eflags = (1<<9) | (1<<2);
+    ctxt->user_regs.eflags = 1 << 9; /* Interrupt Enable */
 
     /* FPU is set up to default initial state. */
     memset(&ctxt->fpu_ctxt, 0, sizeof(ctxt->fpu_ctxt));
index 3260661acc968c1a68d4ee5b980cafb7c0217191..ecdb5d44e0e1987b961a7eb15ffa63673dc87859 100644 (file)
@@ -495,7 +495,7 @@ xc_plan9_build(int xc_handle,
 
        /* why is this set? */
        ctxt->user_regs.esi = ctxt->user_regs.esp;
-       ctxt->user_regs.eflags = (1 << 9) | (1 << 2);
+       ctxt->user_regs.eflags = 1 << 9; /* Interrupt Enable */
 
        /* FPU is set up to default initial state. */
        memset(&ctxt->fpu_ctxt, 0, sizeof(ctxt->fpu_ctxt));
index a89b783feeb398efe6c6be1ed3bb31909c3ff7fe..738d089b525935d478189c2a2e100f9c7ae52fd2 100644 (file)
@@ -447,7 +447,7 @@ static int setup_guest(int xc_handle,
     ctxt->user_regs.esi = vboot_params_start;
     ctxt->user_regs.edi = vboot_params_start + 0x2d0;
 
-    ctxt->user_regs.eflags = (1<<2);
+    ctxt->user_regs.eflags = 0;
 
     return 0;
 
index cd237581d21c74962304880ca3a9c4ecb9a732b2..298d65d4aa5fda8619d25c31f47013d2ecf99a93 100644 (file)
@@ -409,13 +409,15 @@ int arch_set_info_guest(
 
     memcpy(&ed->arch.guest_context, c, sizeof(*c));
 
-    /* IOPL privileges are virtualised. */
-    ed->arch.iopl = (ed->arch.guest_context.user_regs.eflags >> 12) & 3;
-    ed->arch.guest_context.user_regs.eflags &= ~EF_IOPL;
+    if ( !(c->flags & VGCF_VMX_GUEST) )
+    {
+        /* IOPL privileges are virtualised. */
+        ed->arch.iopl = (ed->arch.guest_context.user_regs.eflags >> 12) & 3;
+        ed->arch.guest_context.user_regs.eflags &= ~EF_IOPL;
 
-    /* Clear IOPL for unprivileged domains. */
-    if ( !IS_PRIV(d) )
-        ed->arch.guest_context.user_regs.eflags &= 0xffffcfff;
+        /* Ensure real hardware interrupts are enabled. */
+        ed->arch.guest_context.user_regs.eflags |= EF_IE;
+    }
 
     if ( test_bit(EDF_DONEINIT, &ed->flags) )
         return 0;